/**
 * @description 邀请好友
 */
import React from 'react';
import EntryBase from "../Common/EntryBase";
import loadable from "commons/loadable";
import RouterNotMatch from "components/RouterNotMatch";
import { HashRouter, Route, Switch, Redirect } from 'react-router-dom';
import wxShare from "commons/wxShare";

class App extends EntryBase {
    constructor(props) {
        super(props);
        this.state = {}
    }
    componentDidMount() {
        super.componentDidMount();
        //设置分享
        let shareData = {};
        shareData.link = `https://${location.host}/activity/inviteNew/index.html?uid=${localStorage.getItem('UserId')}`;
        // shareData.link =`https://m.heyjie.cn/zt/2019/10/inviteNew/index.html?uid=${localStorage.getItem('UserId')}`;
        shareData.title = `吃喝玩乐5折起，新人仅需1分钱！还送大红包！`;
        shareData.desc = `我80%的好友都注册了，你还等什么呢`;
        wxShare(shareData);
    }
    render() {
        return (
            <HashRouter>
                <Switch>
                    <Route path="/Home" component={loadable(() => import("./Home"))} />
                    <Route path="/GetCoupon/:redPacketNo" component={loadable(() => import("./GetCoupon"))} />
                    <Route path="/MyFriend" component={loadable(() => import("./MyFriend"))} />
                    <Route path="/Invite" component={loadable(() => import("./Invite"))} />
                    <Route path="*" component={RouterNotMatch} />
                </Switch>
            </HashRouter>
        )
    }
}

export default App;